#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include <glib.h>

#include "kylin-verify.h"
#include "kylin-activation.h"
#include "text-i18n.h"

#define KYLIN_INFORMATION_FILE "/etc/.kyinfo"
#define KYLIN_LICENSE_FILE "/etc/LICENSE"

#ifndef LICENSE_GROUP
#define LICENSE_GROUP "license"
#endif

/*
 * kylin_activation_print_result_message, print message according to result number
 */
extern void kylin_activation_print_result_message(int result);

/*
 * kylin_activation_verify, verify LICENSE file and print plain text of LICENSE file  
 * return NO_ERROR if succeed, or error number if not
 */
extern int kylin_activation_verify();

int main(int argc, char** argv)
{
	int ret;

	setlocale(LC_MESSAGES, "");
	bindtextdomain (PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);
	bind_textdomain_codeset(PACKAGE, "utf8");

	ret = kylin_activation_verify();
	if(ret != NO_ERROR)
		kylin_activation_print_result_message(ret);

	exit(ret);
}
